<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.goodedeeds.webapp.controller.VendorAction" %>
<%@ page import="com.goodedeeds.domain.resource.Vendor" %>
<%@ page import="com.goodedeeds.webapp.controller.ResourcePageAction" %>
<%--@elvariable id="actionBean" type="com.goodedeeds.webapp.controller.VendorAction"--%>
<%@ include file="/WEB-INF/jsp/include/taglibs.jsp"%>
<div style="text-align: center; font-size: 1.5em;">Vendor List</div>

<div>
    <stripes:link href="<%=VendorAction.URL%>">
        All Vendors
    </stripes:link> |
    <stripes:link href="<%=VendorAction.URL%>" event="edit">
        Create New Vendor
    </stripes:link>
    <stripes:form action="<%=VendorAction.URL%>" method="post">
        <stripes:text name="keyword"/>
        <stripes:submit name="search" value="Search"/>
    </stripes:form>
</div>

<c:if test="${!empty actionBean.vendors}">
    <table>
        <c:forEach items="${actionBean.vendors}" var="vendor">
            <tr>
                <td>
                    <stripes:link href="<%=ResourcePageAction.URL%>" event="show">
                        <stripes:param name="pageId" value="${vendor.defaultPageId}"/>
                        ${vendor.previewHtml}
                    </stripes:link>
                </td>
            </tr>
        </c:forEach>
    </table>
</c:if>